<template>
  <div class="home">
    <div class="center-container">
      <button @click="handleClick" class="custom-button">获取小程序</button>
    </div>
    <div class="dropdowns-container">
      <el-select v-model="selectedOption1" placeholder="轮播图" class="custom-select">
        <el-option
          v-for="option in options"
          :key="option.value"
          :label="option.label"
          :value="option.value">
        </el-option>
      </el-select>
      <el-select v-model="selectedOption2" placeholder="主题色" class="custom-select">
        <el-option
          v-for="option in options"
          :key="option.value"
          :label="option.label"
          :value="option.value">
        </el-option>
      </el-select>
      <el-select v-model="selectedOption3" placeholder="公告管理" class="custom-select">
        <el-option
          v-for="option in options"
          :key="option.value"
          :label="option.label"
          :value="option.value">
        </el-option>
      </el-select>
    </div>
  </div>
</template>

<script setup name="Index">
import { ElSelect, ElOption } from 'element-plus';
import 'element-plus/dist/index.css';

const selectedOption1 = ref('');
const selectedOption2 = ref('');
const selectedOption3 = ref('');
const options = [
  { value: 'option1', label: '选项一' },
  { value: 'option2', label: '选项二' },
  { value: 'option3', label: '选项三' }
];

function handleClick() {
  console.log('按钮被点击');
}

function goTarget(url) {
  window.open(url, '__blank')
}
</script>

<style scoped lang="scss">
.home {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100vh;
  background-color: #f0f0f0;

  .center-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 200px; // 控制按钮宽度
    margin: auto; // 上下居中

    .custom-button {
      padding: 10px 20px;
      font-size: 16px;
      color: white;
      background-color: #4CAF50;
      border: none;
      border-radius: 5px;
      cursor: pointer;

      &:hover {
        background-color: #45a049;
      }
    }
  }

  .dropdowns-container {
    display: flex;
    flex-direction: column;
    gap: 20px; // 下拉框间距
    align-items: flex-end; // 右对齐
    width: 100%;
    max-width: 200px; // 控制下拉框宽度
    margin-left: 50px; // 增加间距

    .custom-select {
      padding: 10px;
      font-size: 16px;
      border: 1px solid #ccc;
      border-radius: 5px;
    }
  }
}
</style>